import { defHttp } from '@/apis/http'
import type { CommonAPI } from '@/apis/schema/all'
/**
 * @description: 站点统计
 */

/** 站点统计-流量分析-带宽 */
export const getApiSiteBandwidthApi: CommonAPI<
  '/api/statistic/site/bandwidth',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/bandwidth`, { data })

/** 站点统计-流量分析-流量 */
export const getApiSiteTrafficApi: CommonAPI<
  '/api/statistic/site/traffic',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/traffic`, { data })

/** 站点统计-流量分析-命中率 */
export const getApiSiteHitApi: CommonAPI<
  '/api/statistic/site/hit-rate',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/hit-rate`, { data })

/** 站点统计-流量分析-请求次数 */
export const getApiSiteRequestApi: CommonAPI<
  '/api/statistic/site/request-count',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/request-count`, { data })

/** 首页概览-汇总 */
export const getApiSummaryApi: CommonAPI<'/api/statistic/overview', 'post'> = (
  data
) => defHttp.post(`/api/statistic/overview`, { data })

/** 站点统计-流量分析-流量汇总 */
export const getApiSiteSummaryApi: CommonAPI<
  '/api/statistic/site/summary',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/summary`, { data })

/** 站点统计-安全分析-概览 */
export const getApiWafInfoApi: CommonAPI<
  '/api/statistic/site/waf-info',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/waf-info`, { data })

/** 站点统计-安全分析-规则曲线 */
export const getApiWafListApi: CommonAPI<
  '/api/statistic/site/waf-list',
  'post'
> = (data) => defHttp.post(`/api/statistic/site/waf-list`, { data })

/** 节点统计-安全分析-概览 */
export const getApiNodeWafInfoApi: CommonAPI<
  '/api/statistic/node/waf-info',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/waf-info`, { data })

/** 节点统计-安全分析-规则曲线 */
export const getApiNodeWafListApi: CommonAPI<
  '/api/statistic/node/waf-list',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/waf-list`, { data })

/** 节点统计-带宽上行 */
export const getApiNodeUpApi: CommonAPI<
  '/api/statistic/node/up-bandwidth',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/up-bandwidth`, { data })

/** 节点统计-带宽下行 */
export const getApiNodeDownApi: CommonAPI<
  '/api/statistic/node/down-bandwidth',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/down-bandwidth`, { data })

/** 节点统计-CPU使用率 */
export const getApiNodeCpuApi: CommonAPI<
  '/api/statistic/node/cpu-used-percent',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/cpu-used-percent`, { data })

/** 节点统计-内存使用率 */
export const getApiNodeMemoryApi: CommonAPI<
  '/api/statistic/node/mem-used-percent',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/mem-used-percent`, { data })

/** 节点统计-连接数 */
export const getApiNodeNumberApi: CommonAPI<
  '/api/statistic/node/connection',
  'post'
> = (data) => defHttp.post(`/api/statistic/node/connection`, { data })

/** 查询站点 简易数据 */
export const getApiSiteSimpleApi: CommonAPI<'/api/site/simple-list', 'get'> = (
  params
) => defHttp.get(`/api/site/simple-list`, { params })

/** 查询节点 简易数据 */
export const getApiNodeSimpleApi: CommonAPI<'/api/node/simple-list', 'get'> = (
  params
) => defHttp.get(`/api/node/simple-list`, { params })
